namespace Brjnk.Common
{
    using System.Configuration;

    /// <summary>
    /// </summary>
    public sealed class UnitsSettings : ApplicationSettingsBase
    {
        private static UnitsSettings instance;

        private UnitsSettings() { }

        static UnitsSettings()
        {
            instance = new UnitsSettings();
        }

        public static UnitsSettings Instance { get { return instance; } }

        [UserScopedSetting()]
        [DefaultSettingValue("Degrees")]
        public CoordinationFormat Gps
        {
            get { return (CoordinationFormat)base["Gps"]; }
            set { base["Gps"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("MetresPerSecond2")]
        public AccelerationUnit Acceleration
        {
            get { return (AccelerationUnit)base["Acceleration"]; }
            set { base["Acceleration"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("Kilometre")]
        public DistanceUnit Distance
        {
            get { return (DistanceUnit)base["Distance"]; }
            set { base["Distance"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("Metre")]
        public DistanceUnit Elevation
        {
            get { return (DistanceUnit)base["Elevation"]; }
            set { base["Elevation"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("KilometersPerHour")]
        public SpeedUnit Speed
        {
            get { return (SpeedUnit)base["Speed"]; }
            set { base["Speed"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("Percentage")]
        public SlopeUnit Slope
        {
            get { return (SlopeUnit)base["Slope"]; }
            set { base["Slope"] = value; }
        }

        [UserScopedSetting()]
        [DefaultSettingValue("Centimetre")]
        public CmOrIn CentimeterOrInch
        {
            get { return (CmOrIn)base["CentimeterOrInch"]; }
            set { base["CentimeterOrInch"] = value; }
        }
    }
}